<?php /*a:2:{s:49:"D:\php\phpEnv\www\www.tp.com\view\user\index.html";i:1715912321;s:50:"D:\php\phpEnv\www\www.tp.com\view\public\base.html";i:1703752521;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- 引入 Bootstrap CSS -->
    <link rel="stylesheet" type="text/css" href="http://localhost:8000/static/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="http://localhost:8000/static/css/style.css" />

    <!-- 移动设备优先 -->
    <meta name="viewport" content="width=device-width, initial-scale=1,shrink-to-fit=no">
</head>
<body>

<!--导航-->
<nav class="navbar navbar-light bg-light shadow-sm">
    <a href="#"></a>
    <div class="nav-item dropdown mr-5">
        <a class="nav-link dropdown-toggle text-secondary" href="#"
           data-toggle="dropdown">
            <?php echo session('admin'); ?>
        </a>
        <div class="dropdown-menu">
            <a class="dropdown-item" href="#">个人中心</a>
            <a class="dropdown-item" href="<?php echo url('/logout'); ?>">退出管理</a>
        </div>
    </div>
</nav>

<!--核心部分-->
<div class="container pt-5 mt-5">
    <div class="row" >
        <div class="col-3 siadebar">
            <button class="btn btn-secondary"><a href="<?php echo url('/'); ?>">用户管理</a></button>
            <button class="btn btn-secondary"><a href="<?php echo url('/borrow/registration'); ?>">借出登记</a></button>
            <button class="btn btn-secondary"><a href="<?php echo url('/borrow'); ?>">设备借出</a></button>
            <button class="btn btn-secondary"><a href="<?php echo url('/auth'); ?>">权限管理</a></button>
        </div>
        <div class="col-9 main">
            <!--搜索表单-->
            
<form action="<?php echo url('/user'); ?>" class="pb-3">
  <div class="form-row">
    <div class="col-form-label">
      <label for="username">借用人：</label>
    </div>
    <div class="col-2">
      <input type="text" id="username" name="username" placeholder="查询的借用人" class="form-control">
    </div>
    <div class="col-form-label">
      <label for="email">邮箱：</label>
    </div>
    <div class="col-2">
      <input type="text" id="email" name="email" placeholder="查询的邮箱" class="form-control">
    </div>
    <div class="col-form-label">
      <label for="gender">性别：</label>
    </div>
    <div class="col-auto">
      <select name="gender" id="gender" class="custom-select">
        <option selected value="">选择性别：</option>
        <option value="男">男</option>
        <option value="女">女</option>
      </select>
    </div>
    <div class="col-auto">
      <button class="btn btn-primary">搜索</button>
      <a href="<?php echo url('/user/create'); ?>" class="btn btn-success">添加用户</a>
    </div>
  </div>
</form>

<!--列表-->
<table class="table table-bordered">
  <thead class="thead-light">
  <tr>
    <th class="text-center">ID</th>
    <th>借用人</th>
    <th class="text-center">性别</th>
    <th>邮箱</th>
    <th class="text-center">状态</th>
    <th class="text-center <?php echo $orderTime=='desc' ? ''  :  'dropup'; ?>">
      <a href="<?php echo app\common\Tool::url('create_time'); ?>create_time=<?php echo htmlentities($orderTime); ?>" class="text-secondary text-decoration-none dropdown-toggle">设备借出时间</a>
    </th>
    <th class=>部门</th>
    <th class=>电话</th>
    <th class="text-center">操作</th>
  </tr>
  </thead>
  <tbody>
  <?php $empty = '<tr><td colspan="7" class="text-center text-muted">没有数据</td></tr>'; if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$obj): $mod = ($i % 2 );++$i;?>
  <tr>
    <td class="text-center"><?php echo htmlentities($obj['id']); ?></td>
    <td ><?php echo htmlentities($obj['username']); ?></td>
    <td class="text-center"><?php echo htmlentities($obj['gender']); ?></td>
    <td><?php echo htmlentities($obj['email']); ?></td>
    <td class="text-center">
      <span class="badge btn-<?php echo htmlentities($obj['badge']); ?>"><?php echo htmlentities($obj['status']); ?></span>
    </td>
    <td class="text-center"><?php echo htmlentities($obj['create_time']); ?></td>
    <td ><?php echo htmlentities($obj['group']); ?></td>
    <td class="text-center"><?php echo htmlentities($obj['phone']); ?></td>
    <td >
      <form action="<?php echo url('/user/'.$obj['id']); ?>" method="post">
        <input type="hidden" name="_method" value="delete">
        <button class="btn btn-danger btn-sm btn-delete">删除</button>
        <a href="<?php echo url('/user/'.$obj['id'].'/edit'); ?>" class="btn btn-warning btn-sm">修改</a>
      </form>
    </td>
  </tr>
  <?php endforeach; endif; else: echo "$empty" ;endif; ?>
  </tbody>
</table>

<!--分页-->
<?php echo $list; ?>

        </div>
    </div>
</div>
<!-- 引入 JS 文件 -->
<script type="text/javascript" src="http://localhost:8000/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="http://localhost:8000/static/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">
    $('.btn-delete').click(() => {
        let flag = confirm('您真的要删除这条数据吗？');
        return flag ? true : false;
    });
    $('[data-toggle="tooltip"]').tooltip();
</script>
</body>
</html>

